package com.raymond.queue.common.handler;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 编解码策略
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-07-15 09:11
 */
public class BaseHandlerStrategy {
    private static final Map<Integer, BaseHandler> HANDLER_MAP = new ConcurrentHashMap<>();

    public static void putBaseHandler(Integer commandId, BaseHandler baseDecoder) {
        HANDLER_MAP.put(commandId, baseDecoder);
    }

    public static BaseHandler getBaseHandler(int commandId) {
        return HANDLER_MAP.get(commandId);
    }


}
